package cn.hss.object.dt;

/**矩形
 * @author 作者：HeShaoShuai
 * @Email 邮箱：2569819541@qq.com
 * @Date 日期：2023/4/25 17:23
 * @Package 包名：cn.hss.object.dt
 * @Project 项目名：JavaSE
 * @Version 1.0
 */
public class MyRectangle extends GeometricObject{
	private double width;//宽
	private double height;//长

	public MyRectangle(String color, double weight,
	                   double width, double height) {
		super(color, weight);
		this.width = width;
		this.height = height;
	}
	//计算矩形面积的方法

	@Override
	public double findArea() {
		return height*width;
	}

	public double getWidth() {
		return width;
	}

	public void setWidth(final double width) {
		this.width = width;
	}

	public double getHeight() {
		return height;
	}

	public void setHeight(final double height) {
		this.height = height;
	}
}